package Override;

/**
 * @author げっしょく
 * @date 2021/7/14
 */
public class Test1 {
    public static void main(String[] args) {
        PeoPle ren = new PeoPle("zhangsan");
        ren.speak();
        ChinaPeople Chese = new ChinaPeople();
        Chese.setName("lisi");
        Chese.speak();
        UsaP usa = new UsaP();
        usa.setName("baobo");
        usa.speak();
    }
}

class PeoPle{
    private String name;

    public PeoPle() {
    }

    public PeoPle(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void speak(){
        System.out.println(this.name+"正在讲话");
    }
}

class ChinaPeople extends PeoPle{
    public void speak(){
        System.out.println(getName()+"正在说普通话");
    }
}
class UsaP extends PeoPle{
    public void speak(){
        System.out.println(this.getName() + "正在说英语");
    }
}